{include file="public/layout" /}
<style>
    .images-upload .size{
        width: 100%;
        margin-top: 5px;
        font-size: 14px;
        float: left;
    }
    .images-upload .size input{
        width:12%;
        text-align: center;
    }
    .images-upload .pricearea{
        width: 100%;
        margin-top: 5px;
        font-size: 14px;
        float: left;
    }
    .images-upload .pricearea input{
        width:16%;
    }
    .images-upload .selectdiv{
        width: 100%;
        margin-top: 5px;
        font-size: 14px;
        float: left;
    }
    .images-upload .selectdiv select{
        width:48%;
    }
    .images-upload .characteristic{
        width: 100%;
        margin-top: 5px;
        font-size: 14px;
        float: left;
    }
    .operation_6 a{
        float: right;
    }
</style>
<body>
{load href="__PUBLIC__/plugins/Ueditor/ueditor.config.js" /}
{load href="__PUBLIC__/plugins/Ueditor/ueditor.all.min.js" /}
{load href="__PUBLIC__/plugins/Ueditor/lang/zh-cn/zh-cn.js" /}
<script type="text/javascript" src="__SKIN__/js/jquery-ui/jquery-ui.min.js?v={$version}"></script>
<div class="layui-fluid" id="LAY-component-layer-list">
    <div class="layui-row">
        <div class="layui-col-md12">
            <div class="layui-card">
                <div class="">
                    <form class="layui-form" id="post_form"  action="{:url('Xiaoqu/add')}" onsubmit="return false;">
                        <div class="bt-close">
                            <span class="layui-layer-setwin" ><a onclick="close_this();" class="layui-layer-ico layui-layer-close layui-layer-close1"></a></span>
                        </div>
                        <div class="layui-tab layui-tab-card">
                            <ul class="layui-tab-title">
                                <li class="layui-this">基本信息</li>
                                <li>配套信息</li>
                                <li>相册选项</li>
                            </ul>
                            <div class="layui-tab-content web-system " style="padding:0 0 40px 0">
                                <!--常规选项-->
                                <div class="layui-tab-item layui-show">
                                    <div class="layui-row layui-col-space15">

                                        <div class="layui-row w-max" style="padding-top: 20px;">
                                            <div class="layui-card">
                                                <div class="layui-card-body" pad15>
                                                    <div class="layui-form" wid100 lay-filter="">
                                                        {notempty name="$channelJoin"}
                                                        <div class="layui-form-item">
                                                            <label class="layui-form-label">关联{$channelJoin.ntitle}</label>
                                                            <div class="layui-input-inline layadmin-layer-demo">
                                                                <input type="hidden" name="joinaid" id="joinaid" lay-verify="required" value="0">
                                                                <button class="layui-btn layui-ton" data-name="{$channelJoin.ntitle}" data-url="{$ajaxSelectHouseUrl}" data-type="select_house">选择{$channelJoin.ntitle}</button>
                                                                <span style="display: none;" class="tower-add" id="join_title"></span>
                                                            </div>
                                                        </div>
                                                        {/notempty}
                                                        {notempty name="$channelOrigin.is_join_user"}
                                                        <div class="layui-form-item">
                                                            <label class="layui-form-label">关联经纪人</label>
                                                            <div class="layui-input-inline layadmin-layer-demo" id="relate">
                                                                <button class="layui-btn layui-ton" data-type="select_relate">选择经纪人</button>
                                                            </div>
                                                        </div>
                                                        {/notempty}
                                                        <div class="layui-form-item">
                                                            <label class="layui-form-label">{notempty name="$addonFieldExtList.province_id.ifrequire"}<b>*</b>{/notempty}所属区域</label>
                                                            <div class="layui-input-inline w120">
                                                                <select name="province_id" id="province_id"  lay-filter="province_id" >
                                                                    <option value="0">请选择省</option>
                                                                    {eju:volist name=':get_province_list()' id='vo'}
                                                                    <option value="{$vo.id}" {eq name="$province_id" value="$vo.id" } selected {/eq} >{$vo.name}</option>
                                                                    {/eju:volist}
                                                                </select>
                                                            </div>
                                                            <div class="layui-input-inline w120">
                                                                <select name="city_id" id="city_id"   lay-filter="city_id"  lay-verify="check_cityid">
                                                                    <option value="">请选择城市</option>
                                                                </select>
                                                            </div>
                                                            <div class="layui-input-inline none w120" id="area_div">
                                                                <select name="area_id" id="area_id">
                                                                    <option value="">请选择区域</option>
                                                                </select>
                                                            </div>
                                                            <div class="layui-form-mid layui-word-aux ey_helptips"></div>
                                                            <div class="layui-form-inline2 ey_helptips_txt none">后台菜单>系统配置>区域管理</div>
                                                        </div>
                                                        <div class="w-out fl mt15">
                                                            <label class="layui-form-label">{notempty name="$addonFieldExtList.title.ifrequire"}<b>*</b>{/notempty}{$channeltype_info['ntitle']}名称</label>
                                                            <div class="layui-input-inline w-in">
                                                                <input type="text" name="title" id="title"  placeholder="丰祥花苑" lay-verify="check_title" value="" class="layui-input">
                                                            </div>
                                                        </div>
                                                        <div class="w-out fl mt15 {empty name="$addonFieldExtList['average_price']['ifeditable']"}none{/empty}">
                                                        <label class="layui-form-label">{notempty name="$addonFieldExtList.average_price.ifrequire"}<b>*</b>{/notempty}{$addonFieldExtList['average_price']['title']}</label>
                                                        <div class="layui-input-inline w-in" >
                                                            <div class="layui-input-inline w135" >
                                                                <input type="text" name="addonFieldSys[average_price]" id="average_price"  placeholder="12000"  lay-verify="check_price" value="" class="layui-input" onkeyup="this.value=this.value.replace(/[^0-9]/g,'');" onpaste="this.value=this.value.replace(/[^0-9]/g,'');">
                                                            </div>
                                                            <div class="layui-input-inline w120 {empty name="$addonFieldExtList['price_units']['ifeditable']"}none{/empty}" >
                                                            <select name="addonFieldSys[price_units]" id="price_units">
                                                                {volist name="$addonFieldExtList['price_units']['dfvalue']" id="v2"}
                                                                <option value="{$v2}">{$v2}</option>
                                                                {/volist}
                                                            </select>
                                                        </div>
                                                    </div>
                                                </div>
                                                <div class="w-out fl mt15 {empty name="$arctype_html_show"}none{/empty}">
                                                    <label class="layui-form-label"><b>*</b>所属栏目</label>
                                                    <div class="layui-input-inline w-in" >
                                                        <select name="typeid" id="typeid" lay-verify="check_typeid">
                                                            <option value="0">请选择栏目…</option>
                                                            {$arctype_html}
                                                        </select>
                                                    </div>
                                                </div>

                                            <div class="w-out fl mt15 {empty name="$addonFieldExtList['address']['ifeditable']"}none{/empty}">
                                            <label class="layui-form-label">{notempty name="$addonFieldExtList.address.ifrequire"}<b>*</b>{/notempty}{$addonFieldExtList['address']['title']}</label>
                                            <div class="layui-input-inline w-in">
                                                <input type="text" name="addonFieldSys[address]" id="address" value="{$addonFieldExtList['address']['dfvalue']}"  placeholder="{$addonFieldExtList['address']['remark']}"  lay-verify="check_address" value="" class="layui-input">
                                            </div>
                                        </div>
                                        <div class="w-out fl mt15 {empty name="$addonFieldExtList['sales_address']['ifeditable']"}none{/empty}">
                                        <label class="layui-form-label">{notempty name="$addonFieldExtList.sales_address.ifrequire"}<b>*</b>{/notempty}{$addonFieldExtList['sales_address']['title']}</label>
                                        <div class="layui-input-inline w-in">
                                            <input type="text" name="addonFieldExt[sales_address]" id="sales_address" value="{$addonFieldExtList['sales_address']['dfvalue']}"  placeholder="{$addonFieldExtList['sales_address']['remark']}" class="layui-input">
                                        </div>
                                    </div>
                                    <div class="w-out fl mt15 {empty name="$addonFieldExtList['opening_time']['ifeditable']"}none{/empty}">
                                    <label class="layui-form-label">{notempty name="$addonFieldExtList.opening_time.ifrequire"}<b>*</b>{/notempty}{$addonFieldExtList['opening_time']['title']}</label>
                                    <div class="layui-input-inline w-in">
                                        <div class="layui-input-inline w155">
                                            <input type="text" name="addonFieldSys[opening_time]" id="opening_time"  autocomplete="off" placeholder="{php}echo date('Y-m-d H:i:s'){/php}"  value="" class="layui-input">
                                        </div>
                                        <div class="layui-input-inline w100 {empty name="$addonFieldExtList['opening_time_memo']['ifeditable']"}none{/empty}">
                                        <input type="text" name="addonFieldExt[opening_time_memo]" id="opening_time_memo" value="{$addonFieldExtList['opening_time_memo']['dfvalue']}"  placeholder="{$addonFieldExtList['opening_time_memo']['remark']}" class="layui-input">
                                    </div>
                                </div>
                                <div class="layui-form-mid layui-word-aux ey_helptips fr"></div>
                                <div class="layui-form-inline2 ey_helptips_txt none">{$addonFieldExtList['opening_time_memo']['remark']}</div>
                            </div>
                            <div class="w-out fl mt15 {empty name="$addonFieldExtList['complate_time']['ifeditable']"}none{/empty}">
                            <label class="layui-form-label">{notempty name="$addonFieldExtList.complate_time.ifrequire"}<b>*</b>{/notempty}{$addonFieldExtList['complate_time']['title']}</label>
                            <div class="layui-input-inline w-in">
                                <div class="layui-input-inline w155">
                                    <input type="text" name="addonFieldSys[complate_time]" id="complate_time"  autocomplete="off" placeholder="{php}echo date('Y-m-d H:i:s'){/php}"  value=""  class="layui-input">
                                </div>
                                <div class="layui-input-inline w100 {empty name="$addonFieldExtList['complate_time_memo']['ifeditable']"}none{/empty}">
                                <input type="text" name="addonFieldExt[complate_time_memo]" id="complate_time_memo" value="{$addonFieldExtList['complate_time_memo']['dfvalue']}"  placeholder="{$addonFieldExtList['complate_time_memo']['remark']}" class="layui-input">
                            </div>
                        </div>
                        <div class="layui-form-mid layui-word-aux ey_helptips fr"></div>
                        <div class="layui-form-inline2 ey_helptips_txt none">{$addonFieldExtList['opening_time_memo']['remark']}</div>
                </div>
                <div class="w-out fl mt15 {empty name="$addonFieldExtList['sale_phone']['ifeditable']"}none{/empty}">
                <label class="layui-form-label">{notempty name="$addonFieldExtList.sale_phone.ifrequire"}<b>*</b>{/notempty}{$addonFieldExtList['sale_phone']['title']}</label>
                <div class="layui-input-inline w-in">
                    <div class="layui-input-inline w150">
                        <input type="text" name="addonFieldSys[sale_phone]" id="sale_phone"  lay-verify="check_tellphone" value="{$addonFieldExtList['sale_phone']['dfvalue']}"  placeholder="{$addonFieldExtList['sale_phone']['remark']}" class="layui-input" onkeyup="this.value=this.value.replace(/[^0-9-]/g,'');" onpaste="this.value=this.value.replace(/[^0-9-]/g,'');">
                    </div>
                    <div class="layui-input-inline w20">
                        转
                    </div>
                    <div class="layui-input-inline w80">
                        <input type="text" name="addonFieldSys[phone_code]" id="phone_code" value="{$addonFieldExtList['phone_code']['dfvalue']}"  placeholder="{$addonFieldExtList['phone_code']['remark']}" class="layui-input">
                    </div>
                </div>
            </div>
            <div class="w-out fl mt15 {empty name="$addonFieldExtList['licence']['ifeditable']"}none{/empty}">
            <label class="layui-form-label">{notempty name="$addonFieldExtList.licence.ifrequire"}<b>*</b>{/notempty}{$addonFieldExtList['licence']['title']}</label>
            <div class="layui-input-inline w-in">
                <input type="text" name="addonFieldExt[licence]" id="licence" value="{$addonFieldExtList['licence']['dfvalue']}"  placeholder="{$addonFieldExtList['licence']['remark']}" class="layui-input">
            </div>
        </div>
        <div class="w-out fl mt15 {empty name="$addonFieldExtList['developer']['ifeditable']"}none{/empty}">
        <label class="layui-form-label">{notempty name="$addonFieldExtList.developer.ifrequire"}<b>*</b>{/notempty}{$addonFieldExtList['developer']['title']}</label>
        <div class="layui-input-inline w-in">
            <input type="text" name="addonFieldExt[developer]" id="developer" value="{$addonFieldExtList['developer']['dfvalue']}"  placeholder="{$addonFieldExtList['developer']['remark']}" class="layui-input">
        </div>
    </div>
    <div class="w-out fl mt15">
        <label class="layui-form-label">{notempty name="$addonFieldExtList.lng.ifrequire"}<b>*</b>{/notempty}地图坐标</label>
        <div class="layui-input-inline w-in">
            <input type="text" name="map" id="map" lay-verify="check_map" placeholder="115.345,22.1349" value="{$map}" class="layui-input">
        </div>
        <div class="layui-form-mid layui-word-aux layadmin-layer-demo fr" style="padding: 0!important">
            <a class="layui-btn layui-btn-primary bt-address fl" data-type="map_mark" title="点击标注楼盘坐标"><i class="layui-icon layui-icon-location"></i></a>
        </div>
    </div>
    <div class="w-out fl mt15 {empty name="$addonFieldExtList['panoram']['ifeditable']"}none{/empty}">
    <label class="layui-form-label">{notempty name="$addonFieldExtList.panoram.ifrequire"}<b>*</b>{/notempty}{$addonFieldExtList['panoram']['title']}</label>
    <div class="layui-input-inline w-in">
        <input type="text" name="addonFieldExt[panoram]" id="panoram" value="{$addonFieldExtList['panoram']['dfvalue']}"  placeholder="{$addonFieldExtList['panoram']['remark']}" class="layui-input">
    </div>
    <div class="layui-input-inline layui-input-company">
        {$addonFieldExtList['panoram']['dfvalue_unit']}
    </div>
    </div>
</div>
</div>
</div>
</div>

<div class="layui-col-md12" style="padding-top:0;">
    <div class="layui-card">
        <div class="layui-card-body" pad15 style="padding-top: 0">
            <div class="layui-form" wid100 lay-filter="">
                <div class="layui-form-item {empty name="$addonFieldExtList['sale_status']['ifeditable']"}none{/empty}">
                <label class="layui-form-label">{notempty name="$addonFieldExtList.sale_status.ifrequire"}<b>*</b>{/notempty}{$addonFieldExtList['sale_status']['title']}</label>
                <div class="layui-input-inline w-max2">
                    {volist name="$addonFieldExtList['sale_status']['dfvalue']" id="v2"}
                    <input type="radio" id="sale_status" name="addonFieldSys[sale_status]" value="{$v2}"  title="{$v2}">
                    {/volist}

                </div>
            </div>
            <div class="layui-form-item {empty name="$addonFieldExtList['characteristic']['ifeditable']"}none{/empty}">
            <label class="layui-form-label">{notempty name="$addonFieldExtList.characteristic.ifrequire"}<b>*</b>{/notempty}{$addonFieldExtList['characteristic']['title']}</label>
            <div class="layui-input-inline w-max2">
                {volist name="$addonFieldExtList['characteristic']['dfvalue']" id="v2"}
                <input type="checkbox" lay-skin="primary" name="addonFieldSys[characteristic][]" value="{$v2}"  title="{$v2}">
                {/volist}

            </div>
        </div>
        <div class="layui-form-item {empty name="$addonFieldExtList['fitment']['ifeditable']"}none{/empty}">
        <label class="layui-form-label">{notempty name="$addonFieldExtList.fitment.ifrequire"}<b>*</b>{/notempty}{$addonFieldExtList['fitment']['title']}</label>
        <div class="layui-input-inline w-max2">
            {volist name="$addonFieldExtList['fitment']['dfvalue']" id="v2"}
            <input type="checkbox" lay-skin="primary" name="addonFieldSys[fitment][]" value="{$v2}"  title="{$v2}">
            {/volist}

        </div>
    </div>
    <div class="layui-form-item {empty name="$addonFieldExtList['building_type']['ifeditable']"}none{/empty}">
    <label class="layui-form-label">{notempty name="$addonFieldExtList.building_type.ifrequire"}<b>*</b>{/notempty}{$addonFieldExtList['building_type']['title']}</label>
    <div class="layui-input-inline w-max2">
        {volist name="$addonFieldExtList['building_type']['dfvalue']" id="v2"}
        <input type="checkbox" lay-skin="primary" name="addonFieldSys[building_type][]" value="{$v2}"  title="{$v2}">
        {/volist}

    </div>
</div>
<div class="layui-form-item {empty name="$addonFieldExtList['manage_type']['ifeditable']"}none{/empty}">
<label class="layui-form-label">{notempty name="$addonFieldExtList.manage_type.ifrequire"}<b>*</b>{/notempty}{$addonFieldExtList['manage_type']['title']}</label>
<div class="layui-input-inline w-max2">
    {volist name="$addonFieldExtList['manage_type']['dfvalue']" id="v2"}
    <input type="checkbox" lay-skin="primary" name="addonFieldSys[manage_type][]" value="{$v2}"  title="{$v2}">
    {/volist}
</div>
</div>
<!--<div class="layui-form-item">-->
    <!--<label class="layui-form-label">文档属性</label>-->
    <!--<div class="layui-input-inline w-max2">-->
        <!--<input type="checkbox" value="1" name="is_head" lay-skin="primary" title="头条[h]">-->
        <!--<input type="checkbox" value="1" name="is_recom" lay-skin="primary" title="推荐[c]">-->
        <!--<input type="checkbox" value="1" name="is_special" lay-skin="primary" title="特推[a]" >-->
        <!--<input type="checkbox" value="1" name="is_b" lay-skin="primary" title="加粗[b]" >-->
        <!--<input type="checkbox" value="1" name="is_litpic" lay-skin="primary" title="图片[p]">-->
        <!--<input type="checkbox" value="1" name="is_jump"  lay-skin="primary" lay-filter="is_jump" title="跳转[j]">-->
    <!--</div>-->
<!--</div>-->
<div class="layui-form-item none"  id="jump_div">
    <label class="layui-form-label">跳转网址</label>
    <div class="layui-input-inline">
        <input type="text" name="jumplinks" id="jumplinks" value="" class="layui-input"  placeholder="http://">
        <p>请输入完整的URL网址（包含http或https），设置后访问该条信息将直接跳转到设置的网址</p>
    </div>
</div>
<div class="layui-form-item">
    <label class="layui-form-label">{notempty name="$addonFieldExtList.litpic.ifrequire"}<b>*</b>{/notempty}缩略图</label>
    <div class="layui-input-inline">
        <div class="upload-box">
            <div class="upload-img fl">
                <div class="icaction none">
                  <span class="load_images">
                     <a href="javascript:void(0);" onclick="BigImages($('#img_litpic').attr('src'));">
                     <i class="layui-icon layui-icon-search mr5"></i>查看
                     </a>
                  </span>
                    <span class="load_images">
                    <a href="javascript:void(0);" data-inputid="litpic" onclick="DelImages(this);">
                    <i class="layui-icon layui-icon-delete mr5"></i>删除
                    </a>
                  </span>
                </div>
                <div class="cover-bg none"></div>
                <img id="img_litpic" src="{$field.litpic|get_default_pic=###}">
            </div>
            <div class="upload-right fl">
                <button class="layui-btn test-upload-demoMore layui-btn-primary layui-btn-sm fl mb10 mr5" lay-data="{number:1,ey_inputId:'litpic',ey_savepath:'allimg'}"><i class="layui-icon">&#xe67c;</i>上传图片</button>
                <button class="layui-btn layui-btn-sm layui-btn-primary layui-btn-sm fl mb10" onClick="GetPictureFolder(1,'litpic');"><i class="layui-icon">&#xe64a;</i>图库</button>
                <input name="litpic" id="litpic" placeholder="图片地址" value="{$field.litpic|default=''}" class="layui-input">
            </div>
        </div>
    </div>
</div>

<!--折叠面板--stra-->
<div class="layui-collapse mt20" lay-filter="component-panel">
    <div class="layui-colla-item">
        <h2 class="layui-colla-title">SEO选项</h2>
        <div class="layui-colla-content">
            <div class="" wid100 lay-filter="">
                <div class="layui-form-item">
                    <label class="layui-form-label">TAG标签</label>
                    <div class="layui-input-inline">
                        <input type="text" value="{$field.tags}" name="tags" id="tags" class="layui-input">
                    </div>
                    <div class="layui-input-inline layadmin-layer-demo">
                        <a class="layui-btn layui-btn-sm" data-type="tags_mark">管理</a>
                        <div class="layui-form-mid layui-word-aux ey_helptips"></div>
                        <div class="layui-form-inline2 ey_helptips_txt none">多个标签用英文逗号（,）分开，单个标签小于12字节</div>
                    </div>
                </div>
                <div class="layui-form-item">
                    <label class="layui-form-label">SEO标题</label>
                    <div class="layui-input-inline">
                        <input type="text" name="seo_title" id="seo_title" value="{$field.seo_title}" class="layui-input">
                    </div>
                    <div class="layui-input-inline layui-form-mid layui-word-aux ey_helptips"></div>
                    <div class="layui-form-inline2 ey_helptips_txt none">一般不超过80个字符，为空时系统自动构成，可以到 <a href="{:url('Seo/index', array('inc_type'=>'seo'))}">SEO设置 - SEO基础</a> 中设置构成规则。</div>
                </div>
                <div class="layui-form-item">
                    <label class="layui-form-label">SEO关键词</label>
                    <div class="layui-input-inline">
                        <input type="text" name="seo_keywords" id="seo_keywords" value="{$field.seo_keywords}" class="layui-input">
                    </div>
                    <div class="layui-input-inline layui-form-mid layui-word-aux ey_helptips"></div>
                    <div class="layui-form-inline2 ey_helptips_txt none">一般不超过100个字符，多个关键词请用英文逗号（,）隔开，建议3到5个关键词。</div>
                </div>
                <div class="layui-form-item">
                    <label class="layui-form-label">SEO描述</label>
                    <div class="layui-input-inline">
                        <textarea name="seo_description" class="layui-textarea">{$field.seo_description}</textarea>
                    </div>
                    <div class="layui-input-inline layui-form-mid layui-word-aux ey_helptips"></div>
                    <div class="layui-form-inline2 ey_helptips_txt none">一般不超过200个字符，不填写时系统自动提取正文的前200个字符</div>
                </div>
            </div>
        </div>
    </div>
    <div class="layui-colla-item">
        <h2 class="layui-colla-title">其他选项</h2>
        <div class="layui-colla-content">
            <div class="" wid100 lay-filter="">
                <div class="layui-form-item">
                    <label class="layui-form-label">作者</label>
                    <div class="layui-input-inline">
                        <input type="text" value="{$field.author}" name="author" id="author" class="layui-input">
                    </div>
                    <div class="layui-input-inline layadmin-layer-demo">
                        <a class="layui-btn layui-btn-sm" data-type="author_mark">设置</a>
                        <div class="layui-form-mid layui-word-aux ey_helptips"></div>
                        <div class="layui-form-inline2 ey_helptips_txt none">设置作者默认名称（将同步至管理员笔名）</div>
                    </div>
                </div>
                <div class="layui-form-item">
                    <label class="layui-form-label">浏览量</label>
                    <div class="layui-input-inline">
                        <input type="text" value="{$field.click}" name="click" id="click" value="465" class="layui-input">
                    </div>
                </div>
                <div class="layui-form-item">
                    <label class="layui-form-label">阅读权限</label>
                    <div class="layui-input-inline">
                        <select name="arcrank" id="arcrank">
                            {volist name="arcrank_list" id="vo"}
                            <option value="{$vo.rank}" {eq name="vo.rank" value="$field.arcrank" }selected{/eq}>{$vo.name}</option>
                            {/volist}
                        </select>
                    </div>
                </div>
                <div class="layui-form-item">
                    <label class="layui-form-label">发布时间</label>
                    <div class="layui-input-inline">
                        <input type="text" class="layui-input" id="add_time" name="add_time" autocomplete="off" value="{php}echo date('Y-m-d H:i:s'){/php}" placeholder="yyyy-MM-dd HH:mm:ss">
                    </div>
                </div>
                <div class="layui-form-item">
                    <label class="layui-form-label">文档模板</label>
                    <div class="layui-input-inline">
                        <select name="tempview" id="tempview">
                            {volist name='$templateList' id='vo'}
                            <option value="{$vo}" {eq name='$vo' value='$tempview'}selected{/eq}>{$vo}</option>
                            {/volist}
                        </select>
                        <input type="hidden" name="type_tempview" value="{$tempview}" />
                    </div>
                </div>
            </div>
        </div>
    </div>
</div>
<!--折叠面板--end-->
</div>
</div>
</div>
</div>
</div>
</div>
<!--项目选项-->
<div class="layui-tab-item ">
    <div class="layui-row layui-col-space15">
        <div class="layui-row w-max" style="padding-top: 20px;">
            <div class="layui-card">
                <div class="layui-card-body" pad15>
                    <div class="layui-form" wid100 lay-filter="">

            <div class="w-out fl mt15 {empty name="$addonFieldExtList['property_fee']['ifeditable']"}none{/empty}">
            <label class="layui-form-label">{notempty name="$addonFieldExtList.property_fee.ifrequire"}<b>*</b>{/notempty}{$addonFieldExtList['property_fee']['title']}</label>
            <div class="layui-input-inline w-in">
                <input type="text" name="addonFieldExt[property_fee]" id="property_fee" value="{$addonFieldExtList['property_fee']['dfvalue']}"  placeholder="{$addonFieldExtList['property_fee']['remark']}" class="layui-input">
            </div>
            <div class="layui-input-inline layui-input-company">{$addonFieldExtList['property_fee']['dfvalue_unit']}</div>
        </div>
        <div class="w-out fl mt15 {empty name="$addonFieldExtList['manage_company']['ifeditable']"}none{/empty}">
        <label class="layui-form-label">{notempty name="$addonFieldExtList.manage_company.ifrequire"}<b>*</b>{/notempty}{$addonFieldExtList['manage_company']['title']}</label>
        <div class="layui-input-inline w-in">
            <input type="text" name="addonFieldExt[manage_company]" id="manage_company" value="{$addonFieldExtList['manage_company']['dfvalue']}"  placeholder="{$addonFieldExtList['manage_company']['remark']}" class="layui-input">
        </div>
    </div>
    <div class="w-out fl mt15 {empty name="$addonFieldExtList['building_num']['ifeditable']"}none{/empty}">
    <label class="layui-form-label">{notempty name="$addonFieldExtList.building_num.ifrequire"}<b>*</b>{/notempty}{$addonFieldExtList['building_num']['title']}</label>
    <div class="layui-input-inline w-in">
        <input type="text" name="addonFieldExt[building_num]" id="building_num" value="{$addonFieldExtList['building_num']['dfvalue']}"  placeholder="{$addonFieldExtList['building_num']['remark']}" class="layui-input">
    </div>
    <div class="layui-input-inline layui-input-company">{$addonFieldExtList['building_num']['dfvalue_unit']}</div>
</div>
<div class="w-out fl mt15 {empty name="$addonFieldExtList['floor_case']['ifeditable']"}none{/empty}">
<label class="layui-form-label">{notempty name="$addonFieldExtList.floor_case.ifrequire"}<b>*</b>{/notempty}{$addonFieldExtList['floor_case']['title']}</label>
<div class="layui-input-inline w-in">
    <input type="text" name="addonFieldExt[floor_case]" id="floor_case" value="{$addonFieldExtList['floor_case']['dfvalue']}"  placeholder="{$addonFieldExtList['floor_case']['remark']}" class="layui-input">
</div>
<div class="layui-input-inline layui-input-company">{$addonFieldExtList['floor_case']['dfvalue_unit']}</div>
</div>
<div class="w-out fl mt15 {empty name="$addonFieldExtList['carport']['ifeditable']"}none{/empty}">
<label class="layui-form-label">{notempty name="$addonFieldExtList.carport.ifrequire"}<b>*</b>{/notempty}{$addonFieldExtList['carport']['title']}</label>
<div class="layui-input-inline w-in">
    <input type="text" name="addonFieldExt[carport]" id="carport" value="{$addonFieldExtList['carport']['dfvalue']}"  placeholder="{$addonFieldExtList['carport']['remark']}" class="layui-input">
</div>
<div class="layui-input-inline layui-input-company">{$addonFieldExtList['carport']['dfvalue_unit']}</div>
</div>
<div class="w-out fl mt15 {empty name="$addonFieldExtList['households']['ifeditable']"}none{/empty}">
<label class="layui-form-label">{notempty name="$addonFieldExtList.households.ifrequire"}<b>*</b>{/notempty}{$addonFieldExtList['households']['title']}</label>
<div class="layui-input-inline w-in">
    <input type="text" name="addonFieldExt[households]" id="households" value="{$addonFieldExtList['households']['dfvalue']}"  placeholder="{$addonFieldExtList['households']['remark']}" class="layui-input">
</div>
    <div class="layui-input-inline layui-input-company">{$addonFieldExtList['households']['dfvalue_unit']}</div>
</div>
<div class="w-out fl mt15 {empty name="$addonFieldExtList['greening_rate']['ifeditable']"}none{/empty}">
<label class="layui-form-label">{notempty name="$addonFieldExtList.greening_rate.ifrequire"}<b>*</b>{/notempty}{$addonFieldExtList['greening_rate']['title']}</label>
<div class="layui-input-inline w-in">
    <input type="text" name="addonFieldExt[greening_rate]"   id="greening_rate" value="{$addonFieldExtList['greening_rate']['dfvalue']}" onkeyup="this.value=this.value.replace(/[^0-9.%]/g,'');" onpaste="this.value=this.value.replace(/[^0-9.%]/g,'');"  placeholder="{$addonFieldExtList['greening_rate']['remark']}" class="layui-input">
</div>
<div class="layui-input-inline layui-input-company">{$addonFieldExtList['greening_rate']['dfvalue_unit']}</div>
</div>
<div class="w-out fl mt15 {empty name="$addonFieldExtList['plot_ratio']['ifeditable']"}none{/empty}">
<label class="layui-form-label">{notempty name="$addonFieldExtList.plot_ratio.ifrequire"}<b>*</b>{/notempty}{$addonFieldExtList['plot_ratio']['title']}</label>
<div class="layui-input-inline w-in">
    <input type="text" name="addonFieldExt[plot_ratio]"  id="plot_ratio" value="{$addonFieldExtList['plot_ratio']['dfvalue']}" onkeyup="this.value=this.value.replace(/[^0-9.%]/g,'');" onpaste="this.value=this.value.replace(/[^0-9.%]/g,'');"  placeholder="{$addonFieldExtList['plot_ratio']['remark']}" class="layui-input">
</div>
<div class="layui-input-inline layui-input-company">{$addonFieldExtList['plot_ratio']['dfvalue_unit']}</div>
</div>
<div class="w-out fl mt15 {empty name="$addonFieldExtList['property']['ifeditable']"}none{/empty}">
<label class="layui-form-label">{notempty name="$addonFieldExtList.property.ifrequire"}<b>*</b>{/notempty}{$addonFieldExtList['property']['title']}</label>
<div class="layui-input-inline w-in">
    <input type="text"  name="addonFieldExt[property]" id="property" onkeyup="this.value=this.value.replace(/[^0-9]/g,'');" onpaste="this.value=this.value.replace(/[^0-9]/g,'');" placeholder="{$addonFieldExtList['property']['remark']}"  value="{$addonFieldExtList['property']['dfvalue']}" class="layui-input">
</div>
<div class="layui-input-inline layui-input-company">{$addonFieldExtList['property']['dfvalue_unit']}</div>
</div>
<div class="w-out fl mt15 {empty name="$addonFieldExtList['building_age']['ifeditable']"}none{/empty}">
<label class="layui-form-label">{notempty name="$addonFieldExtList.building_age.ifrequire"}<b>*</b>{/notempty}{$addonFieldExtList['building_age']['title']}</label>
<div class="layui-input-inline w-in">
    <input type="text" name="addonFieldSys[building_age]" id="building_age" onkeyup="this.value=this.value.replace(/[^0-9]/g,'');" onpaste="this.value=this.value.replace(/[^0-9]/g,'');" value="{$addonFieldExtList['building_age']['dfvalue']}"  placeholder="{$addonFieldExtList['building_age']['remark']}" class="layui-input">
</div>
<div class="layui-input-inline layui-input-company">{$addonFieldExtList['building_age']['dfvalue_unit']}</div>
</div>
<div class="w-out fl mt15 {empty name="$addonFieldExtList['building_area']['ifeditable']"}none{/empty}">
<label class="layui-form-label">{notempty name="$addonFieldExtList.building_area.ifrequire"}<b>*</b>{/notempty}{$addonFieldExtList['building_area']['title']}</label>
<div class="layui-input-inline w-in">
    <input type="text" name="addonFieldExt[building_area]"  id="building_area" value="{$addonFieldExtList['building_area']['dfvalue']}" onkeyup="this.value=this.value.replace(/[^0-9.]/g,'');" onpaste="this.value=this.value.replace(/[^0-9.]/g,'');" placeholder="{$addonFieldExtList['building_area']['remark']}" class="layui-input">
</div>
<div class="layui-input-inline layui-input-company">{$addonFieldExtList['building_area']['dfvalue_unit']}</div>
</div>
<div class="w-out fl mt15 {empty name="$addonFieldExtList['floor_area']['ifeditable']"}none{/empty}">
<label class="layui-form-label">{notempty name="$addonFieldExtList.floor_area.ifrequire"}<b>*</b>{/notempty}{$addonFieldExtList['floor_area']['title']}</label>
<div class="layui-input-inline w-in">
    <input type="text" name="addonFieldExt[floor_area]" id="floor_area" value="{$addonFieldExtList['floor_area']['dfvalue']}"  onkeyup="this.value=this.value.replace(/[^0-9.]/g,'');" onpaste="this.value=this.value.replace(/[^0-9.]/g,'');"  placeholder="{$addonFieldExtList['floor_area']['remark']}" class="layui-input">
</div>
<div class="layui-input-inline layui-input-company">
    {$addonFieldExtList['floor_area']['dfvalue_unit']}</div>
</div>
</div>
</div>
</div>
</div>

<div class="layui-col-md12" style="padding-top:0;">
    <div class="layui-card">
        <div class="layui-card-body" pad15 style="padding-top:0;">
            <div class="layui-form" wid100 lay-filter="">
                {include file="field/addonextitem" /}
                <div class="layui-form-item layui-form-text {empty name="$addonFieldExtList['location_introduce']['ifeditable']"}none{/empty}">
                <label class="layui-form-label">{notempty name="$addonFieldExtList.location_introduce.ifrequire"}<b>*</b>{/notempty}{$addonFieldExtList['location_introduce']['title']}</label>
                <div class="layui-input-inline">
                    <textarea id="location_introduce" name="addonFieldExt[location_introduce]" class="layui-textarea"></textarea>
                </div>
                <div class="layui-input-inline layui-btn-container " style="width: auto;">
                    <div class="layui-form-mid layui-word-aux ey_helptips"></div>
                    <div class="layui-form-inline2 ey_helptips_txt">{$addonFieldExtList['location_introduce']['remark']}</div>
                </div>
            </div>

            <div class="layui-form-item {empty name="$addonFieldExtList['content']['ifeditable']"}none{/empty}">
            <span class="edit-box-tit">{notempty name="$addonFieldExtList.content.ifrequire"}<b>*</b>{/notempty}{$addonFieldExtList['content']['title']}</span>
            <div class="edit-box-con ">
                <div class="edit-box-textarea2">
                    <textarea  class="ckeditor" lay-ignore id="addonFieldExt_content" data-func="addonFieldExt_content" name="addonFieldExt[content]"></textarea>
                </div>
            </div>
            <div class="layui-input-inline layui-btn-container " style="width: auto;">
                <div class="layui-form-mid layui-word-aux ey_helptips"></div>
                <div class="layui-form-inline2 ey_helptips_txt">{$addonFieldExtList['content']['remark']}</div>
            </div>
        </div>
        <script type="text/javascript">
            UE.getEditor('addonFieldExt_content',{
                serverUrl :"{:url('Ueditor/index',array('savepath'=>'ueditor'))}",
                zIndex: 999,
                initialFrameWidth: "100%", //初化宽度
                initialFrameHeight: 450, //初化高度
                focus: false, //初始化时，是否让编辑器获得焦点true或false
                maximumWords: 99999,
                removeFormatAttributes: 'class,style,lang,width,height,align,hspace,valign',//允许的最大字符数 'fullscreen',
                pasteplain:false, //是否默认为纯文本粘贴。false为不使用纯文本粘贴，true为使用纯文本粘贴
                autoHeightEnabled: false,
                toolbars: ueditor_toolbars
            });
            //必须在提交前渲染编辑器；
            function addonFieldExt_content() {
                //判断编辑模式状态:0表示【源代码】HTML视图；1是【设计】视图,即可见即所得；-1表示不可用
                if(UE.getEditor("addonFieldExt_content").queryCommandState('source') != 0) {
                    UE.getEditor("addonFieldExt_content").execCommand('source'); //切换到【设计】视图
                }
            }
        </script>

    </div>
</div>
</div>
</div>
</div>

</div>
<!--相册选项-->
<div class="layui-tab-item ">
    <div class="layui-row layui-col-space15">
        <div class="layui-col-md12">
            <div class="layui-card">
                <div class="layui-card-body" pad15>
                    <div class="layui-form" wid100 lay-filter="">
                        <div class="layui-form-item">
                            <label class="layui-form-label"><b>*</b>相册分类</label>
                            <div class="layui-input-inline">
                                <select name="photo_type_select" id="photo_type_select">
                                    <option value="0">-请选择-</option>
                                    {volist name=":get_photo_type_list(2)" id="vo"}
                                    <option value="{$vo}">{$vo}</option>
                                    {/volist}
                                </select>
                            </div>
                        </div>
                        <div class="layui-form-item">
                            <label class="layui-form-label">上传相册</label>
                            <div class="layui-input-inline">
                                <div class="upload-box">
                                    <div class="upload-right fl">
                                        <button class="layui-btn multi-upload-demoMore layui-btn-primary layui-btn-sm fl mb10 mr5" lay-data="{number:100,ey_savepath:'allimg',ey_callbefore:'xiaoqu_photo_upload()',ey_callback:'xiaoqu_photo_upload_call_back'}"><i class="layui-icon">&#xe67c;</i>上传图片</button>
                                        <button class="layui-btn layui-btn-sm layui-btn-primary layui-btn-sm fl mb10" onClick="GetBeforePictureFolder(100,'hehe','xiaoqu_photo_upload_call_back','xiaoqu_photo_upload()');"><i class="layui-icon">&#xe64a;</i>图库</button>
                                    </div>
                                </div>
                            </div>
                        </div>
                        <div class="layui-form-item ">
                            <label class="layui-form-label"></label>
                            <div class="edit-box-con2 fl sort-list">

                                {volist name="photo_list" id="vo" key="k"}
                                <div class="images-upload ic">
                                    <div class="upimg" title="拖动修改排序">
                                        <div class="icaction" style="display: none;">
                                                                        <span class="load_images" onclick="Images('{$vo.photo_pic}');">
                                                                            <a href="javascript:void(0);" style="color: white">
                                                                                <i class="fa fa-search-plus"></i>查看大图
                                                                            </a>
                                                                        </span>
                                        </div>
                                        <div class="cover-bg" style="display: none;"></div>
                                        <img src="{$vo.photo_pic}">
                                    </div>
                                    <input type="hidden" name="photo_id[]" value="{$vo.photo_id}">
                                    <span class="span_input">
                                                                    <input type="hidden" name="photo_pic[]" value="{$vo.photo_pic}">
                                                                </span>
                                    <span class="select_input">
                                                                    <input type="hidden" name="photo_type[]" value="{$vo.photo_type}">
                                                                </span>
                                    <textarea placeholder="请输入标题..." name="photo_title[]" value="{$vo.photo_title}">{$vo.photo_title}</textarea>
                                    <div class="operation">
                                        <a href="javascript:void(0)"><label>分类：{$vo.photo_type}</label></a>
                                        <a href="javascript:void(0)" onclick="ClearPicArr(this,'{$vo.photo_pic}')" style="float:right"><i class="layui-icon layui-icon-close mr5"></i>删除</a>
                                    </div>
                                </div>
                                {/volist}

                                <div class="images-upload" style="display: none;"></div>
                                <!-- 上传图片显示的样板 start -->
                                <div class="images_upload_tpl" style="display: none;">
                                    <div class="images-upload">
                                        <div class="upimg">
                                            <div class="icaction" style="display: none;">
                                                                            <span class="load_images">
                                                                                <a href="javascript:void(0);" style="color:white">
                                                                                    <i class="layui-icon layui-icon-search mr5"></i>查看大图
                                                                                </a>
                                                                            </span>
                                            </div>
                                            <div class="cover-bg" style="display: none"></div>
                                            <img src="__STATIC__/admin/images/add-button.jpg">
                                        </div>
                                        <input type="hidden"/>
                                        <span class="span_input">
                                                                        <input type="hidden"/>
                                                                    </span>
                                        <textarea placeholder="请输入标题..." style="height: 28px;"></textarea>
                                        <div class="operation">
                                            <a href="javascript:void(0);"></a>
                                            <a href="javascript:void(0);" style="float: right"></a>
                                        </div>
                                    </div>
                                </div>
                                <!-- 上传图片显示的样板 end -->
                            </div>
                        </div>
                    </div>
                </div>
            </div>
        </div>
    </div>

</div>
</div>
</div>
<div class="button-container layadmin-layer-demo">
    <button class="layui-btn layui-btn-sm" lay-submit lay-filter="formSubmit">确认提交</button>
    <button class="layui-btn layui-btn-sm layui-btn-primary"  data-type="return_parent">返回</button>
</div>
</form>
</div>
</div>
</div>
</div>

<script>

    $(document).ready(function(){
        // 鼠标事件，加载查看大图和删除图片
        $(".upload-img").live('mouseover', function(){
            $(this).find('div.icaction').show();
            $(this).find('div.cover-bg').show();
        }).live('mouseout', function(){
            $(this).find('div.icaction').hide();
            $(this).find('div.cover-bg').hide();
        });
        $('#add_time').layDate();
        var city_id = "{$city_id}";
        set_city_list(city_id);
        var area_id = "{$area_id}";
        set_area_list(area_id);
    });
    //光标离开楼盘地址编辑，自动获取坐标
    $("#address").on('blur',function(){
        var province_id = $("#province_id").val(),city_id = $("#city_id").val();area_id = $("#area_id").val();
        var address = $(this).val();
        var url     = "{:url('Map/getLocationByAddress')}";
        var param = {
            province : province_id,
            city : city_id,
            area : area_id,
            address : address
        };
        $.get(url,param,function(res){
            if(res.code == 1)
            {
                $("#map").val(res.data.map);
            }
        });
    });
    var temp = 0;
    var layui_index = layui.config({
        base: '__SKIN__/' //静态资源所在路径
        ,version: '{$version}'
    }).extend({
        index: 'lib/index' //主入口模块
    }).use(['index', 'form'], function(){
        var $ = layui.$
            ,element = layui.element
            ,layer = layui.layer
            ,form = layui.form;

        element.render();

        //监听自定义开关
        form.on('switch', function(data){
            var elemId = data.elem.attributes['lay-filter']['nodeValue'];
            if (data.elem.checked) {
                this.value = 1;
            } else {
                this.value = 0;
            }
            $("input[name='"+elemId+"']").val(this.value);
        });
        /* 触发事件 */
        var active = {
            area:function () {     //区域管理
                set_region();
            }
            ,saleman:function () {      //经纪人管理
                set_saleman();
            }
            ,map_mark:function () {     //标注管理
                set_map();
            }
            ,tags_mark:function () {    //设置标签
                tags_list(this);
            }
            ,author_mark:function () {  //设置作者
                set_author();
            }
            , return_parent:function () {     //返回上级
                var index=parent.layer.getFrameIndex(window.name); //获取当前窗口的name
                parent.layer.close(index);		//关闭窗口
            }
            ,select_relate:function () {    //选择关联经纪人
                var xinfang = layer.open({
                    type : 2,
                    title : '选择联经纪人',
                    area : ['700px','500px'],
                    shade : 0.2,
                    iframeAuto:true,
                    content : "{:url('Users/ajaxSelectRelate')}"+'&func=set_relate_back',
                    end : function(){

                    }
                });
            }
            ,select_house:function () {     //模型关联管理
                var url = $(this).data('url');
                var name = $(this).data('name');
                var xinfang = layer.open({
                    type : 2,
                    title : '选择'+name,
                    area : ['500px','500px'],
                    shade : 0.2,
                    iframeAuto:true,
                    content : url,
                    end : function(){
                    }
                });
                layer.full(xinfang);
            }
        };
        $('#LAY-component-layer-list .layadmin-layer-demo .layui-btn').on('click', function(){
            var type = $(this).data('type');
            active[type] && active[type].call(this);
        });
        form.verify({
            check_typeid: function(value, item){ //value：表单的值、item：表单的DOM对象
                if(0 == value){
                    tabchange(0);
                    return '请选择所属栏目！';
                }
            }
            ,check_title:function (value, item) {
                if(value == '' || undefined == value){
                    tabchange(0);
                    return '必填项不能为空';
                }
            }
            ,check_price:function (value, item) {
                var number = /^[0-9]\d*$/;
                if(value != '' && !number.test(value)){
                    tabchange(0);
                    return '价格只能输入数字';
                }
            }
            ,check_address:function (value, item) {
                if(value == '' || undefined == value){
                    tabchange(0)
                    return '地址项不能为空';
                }
            }
            ,check_cityid:function (value, item) {
                if(0 == value){
                    tabchange(0);
                    return '请选择城市！';
                }
            }
            ,check_tellphone: function(value){
                var phone = /^[0-9-]+$/;
                var flag = phone.test(value);
                if(value != '' && !flag){
                    tabchange(0);
                    return '请输入正确座机号码或手机号';
                }
            }
            ,check_map:function (value, item) {
                if(value == '' || undefined == value){
                    tabchange(0)
                    return '请选择楼盘坐标';
                }
            }
        });
        function tabchange(tabIndex)
        {
            var tabObj = $('div.layui-tab ul.layui-tab-title');
            tabObj.find('li').each(function(){
                $(this).removeClass('layui-this');
            });
            $(tabObj.find('li').get(tabIndex)).addClass('layui-this');
            $('.layui-tab-item').removeClass('layui-show');
            $($('.layui-tab-item').get(tabIndex)).addClass('layui-show');
        }
        //选中跳转链接
        form.on('checkbox(is_jump)',function (obj) {
            if ($(this).is(':checked')) {
                $('#jump_div').show();
            } else {
                $('#jump_div').hide();
            }
        });
        //选中显示优惠内容
        form.on('switch(addonFieldSys[is_discount])',function (obj) {
            if ($(this).is(':checked')) {
                $('#discount_div').show();
            } else {
                $('#discount_div').hide();
            }
        });
        //选中省份模型
        form.on('select(province_id)', function(data){
            set_city_list(0);
            set_area_list(0);
            form.render();
        });
        //选中城市
        form.on('select(city_id)', function(data){
            set_area_list(0);
            form.render();
        });
        //监听提交
        form.on('submit(formSubmit)', function(data){
            var load = layer_loading();
            data.field._ajax = 1;
            $('textarea[class*="ckeditor"]').each(function(index, item){
                data.field[item.name] = item.value;
            });
            $.ajax({
                type : 'post',
                url : "{:url('Xiaoqu/add')}",
                data : data.field,
                dataType : 'json',
                success : function(res){
                    layer.close(load); //关闭loading
                    if(res.code == 1){
                        parent.window.location.href = res.url;
                    }else{
                        layer.msg(res.msg, {icon: 2,time: 2000});
                    }
                },
                error: function(e){
                    layer.close(load); //关闭loading
                    showErrorAlert();
                }
            });
            return false;
        });

    });
    //区域管理
    function set_region() {
        var url = "{:url('Region/index')}";
        var region_iframes = layer.open({
            type: 2,
            title: '区域管理',
            fixed: true, //不固定
            shadeClose: false,
            shade: 0.3,
            content: url
        });
        layer.full(region_iframes);
    }
    //经纪人管理
    function set_saleman() {
        var url = "{:url('Saleman/index')}";
        var saleman_iframes = layer.open({
            type: 2,
            title: '经纪人管理',
            fixed: true, //不固定
            shadeClose: false,
            shade: 0.3,
            content: url
        });
        layer.full(saleman_iframes);
    }
    //标注地图位置
    function set_map()
    {
        var province = $("#province_id").val();
        var city = $("#city_id").val();
        var area = $("#area_id").val();
        if(city==='0' || city === '' || city === null)
        {
            layer.msg('请选择城市',{icon:2});
            return false;
        }
        var map = $("#map").val();
        var url = "{:url('Map/updateLocation')}&province="+province+"&city="+city+"&area="+area+"&map="+map;
        //iframe窗
        var iframes = layer.open({
            type: 2,
            title: '标注地图',
            fixed: true, //不固定
            shadeClose: false,
            shade: 0.3,
            content: url
        });
        layer.full(iframes);
    }
    //自动获取城市列表
    function set_city_list(cityid) {
        var pid =  $("#province_id").val();
        $.ajax({
            url: "{:url('Region/ajax_get_region')}",
            type: 'POST',
            dataType: 'JSON',
            async: false,
            data: {pid:pid,_ajax:1},
            success: function(res){
                if (res.code === 1){
                    $("#city_id").empty();
                    $("#city_id").prepend(res.msg);
                    if (cityid > 0){
                        $("#city_id").val(cityid);
                    }
                }
            },
            error: function(e){
                showErrorMsg();
                return false;
            }
        });
    }
    //自动获取区域
    function set_area_list(areaid) {
        var pid =  $("#city_id").val();
        $.ajax({
            url: "{:url('Region/ajax_get_region')}",
            type: 'POST',
            dataType: 'JSON',
            async: false,
            data: {pid:pid,level:3,_ajax:1},
            success: function(res){
                if (res.code === 1){
                    $("#area_id").empty();
                    $("#area_id").prepend(res.msg);
                    if (areaid > 0){
                        $("#area_id").val(areaid);
                    }
                    if (res.data.isempty == 1){
                        $("#area_div").hide();
                    }else{
                        $("#area_div").show();
                    }
                }
            },
            error: function(e){
                showErrorMsg();
                return false;
            }
        });
    }
    //上传相册前判断
    function xiaoqu_photo_upload(){
        if($('#photo_type_select').val() == 0)
        {
            layer.msg('请选择相册类型',{icon:2});
            return false;
        }
        return true;
    }
    // 上传之后删除组图input
    function ClearPicArr(obj,path)
    {
        $(obj).parent().parent().remove(); // 删除完服务器的, 再删除 html上的图片
        $.ajax({
            type:'POST',
            url:"{:url('Uploadify/delupload')}",
            data:{action:"del", filename:path},
            success:function(){}
        });
    }
    // 鼠标事件，加载查看大图和更新图片
    $(document).ready(function(){
        $(".upimg").live('mouseover', function(){
            $(this).find('div.icaction').show();
            $(this).find('div.cover-bg').show();
        }).live('mouseout', function(){
            $(this).find('div.icaction').hide();
            $(this).find('div.cover-bg').hide();
        });
    });

    // 查看大图
    function Images(links){
        var max_width = 650;
        var max_height = 350;
        var img = "<img src='"+links+"'/>";
        $(img).load(function() {
            width  = this.width;
            height = this.height;
            if (width > height) {
                if (width > max_width) {
                    width = max_width;
                }
                width += 'px';
            } else {
                width = 'auto';
            }
            if (width < height) {
                if (height > max_height) {
                    height = max_height;
                }
                height += 'px';
            } else {
                height = 'auto';
            }

            var links_img = "<img style='width:"+width+";height:"+height+";' src="+links+">";

            layer.open({
                type: 1,
                title: false,
                closeBtn: true,
                shadeClose:true,
                area: [width, height],
                skin: 'layui-layer-nobg', //没有背景色
                content: links_img
            });
        });
    }

    // 图集相册的拖动排序相关 js
    $( ".sort-list" ).sortable({
        start: function( event, ui) {

        }
        ,stop: function( event, ui ) {

        }
    });
    $( ".sort-list" ).disableSelection();


    // 上传图集相册回调函数
    function xiaoqu_photo_upload_call_back(pathObj){
        if (Array.isArray(pathObj)){
            var paths = pathObj;
        }else{
            var paths = [pathObj.url];
        }
        var last_div = $(".images_upload_tpl").html();
        var inputs   = $('.span_input input');
        var photo_type = $("#photo_type_select").val();
        var photo_type_name = $("#photo_type_select").find("option:selected").text();

        for (var i=0;i<paths.length ;i++){
            $(".images-upload:eq(0)").before(last_div);  // 插入一个 新图片
            // 修改他的链接地址
            $(".images-upload:eq(0)").find('span:eq(0)').attr('onclick',"Images('"+paths[i]+"');");
            // 修改他的图片路径
            $(".images-upload:eq(0)").find('img').attr('src',paths[i]);
            // 处理图片路径及隐藏域
            if (inputs.length > '0') {
                // 修改隐藏域，提交ID隐藏域
                $(".images-upload:eq(0)").find('input:eq(0)').attr('name','photo_id[]').attr('value','');
                // 修改隐藏域，提交图片隐藏域
                $(".span_input:eq(0)").find('input:eq(0)').attr('name','photo_pic[]').attr('value',paths[i]);
                //修改隐藏域，提交图片类型 select_input
                $(".images-upload:eq(0)").find('input:eq(0)').attr('name','photo_type[]').attr('value',photo_type);
                // 提交标题
                $(".images-upload:eq(0)").find('textarea:eq(0)').attr('name','photo_title[]');
                // 提交图片类型名称
                $(".images-upload:eq(0)").find('div.operation a:eq(0)').html("<label>分类："+photo_type_name+"</label>");
                // 删除按钮
                $(".images-upload:eq(0)").find('div.operation a:eq(1)').attr('onclick',"ClearPicArr(this,'"+paths[i]+"')").html("<i class='layui-icon layui-icon-close mr5'></i>删除");
            }
        }
    }
    // 上传图集相册回调函数
    function xinfang_huxing_upload_call_back(pathObj){
        if (Array.isArray(pathObj)){
            var paths = pathObj;
        }else{
            var paths = [pathObj.url];
        }
        var last_div = $(".huxing_images_upload_tpl").html();
        var inputs   = $('.characteristic label');
        for (var i=0;i<paths.length ;i++){
            $(".huxing .images-upload:eq(0)").before(last_div);  // 插入一个 新图片
            // 修改他的链接地址
            $(".huxing .images-upload:eq(0)").find('span:eq(0)').attr('onclick',"Images('"+paths[i]+"');");
            // 修改他的图片路径
            $(".huxing .images-upload:eq(0)").find('img').attr('src',paths[i]);
            // 修改隐藏域，提交ID隐藏域
            $(".huxing .images-upload:eq(0)").find('input:eq(0)').attr('name','huxing_id[]').attr('value','');
            // 修改隐藏域，提交图片隐藏域
            $(".huxing .span_input:eq(0)").find('input:eq(0)').attr('name','huxing_pic[]').attr('value',paths[i]);
            // 提交标题
            $(".huxing .images-upload:eq(0)").find('textarea:eq(0)').attr('name','huxing_title[]');
            //提交大小，室-厅-卫-厨
            $(".huxing .images-upload:eq(0)").find('div.size input:eq(0)').attr('name','huxing_room[]');
            $(".huxing .images-upload:eq(0)").find('div.size input:eq(1)').attr('name','huxing_living_room[]');
            $(".huxing .images-upload:eq(0)").find('div.size input:eq(2)').attr('name','huxing_toilet[]');
            $(".huxing .images-upload:eq(0)").find('div.size input:eq(3)').attr('name','huxing_kitchen[]');
            //提交价格，面积
            $(".huxing .images-upload:eq(0)").find('div.pricearea input:eq(0)').attr('name','huxing_price[]');
            $(".huxing .images-upload:eq(0)").find('div.pricearea input:eq(1)').attr('name','huxing_area[]');
            //提交select
            $(".huxing .images-upload:eq(0)").find('div.selectdiv select:eq(0)').attr('name','sale_status[]');
            $(".huxing .images-upload:eq(0)").find('div.selectdiv select:eq(1)').attr('name','huxing_aspect[]');
//                $(".huxing .images-upload:eq(0)").find('div.selectdiv select:eq(2)').attr('name','huxing_fitment[]');
//                $(".huxing .images-upload:eq(0)").find('div.selectdiv select:eq(3)').attr('name','huxing_manage_type[]');
            //提交特色
            for (var j=0;j<inputs.length ;j++){
                $(".huxing .images-upload:eq(0)").find('div.characteristic input:eq('+j+')').attr('name','huxing_characteristic['+temp+'][]');
            }
            temp++;
            // 提交户型说明
            $(".huxing .images-upload:eq(0)").find('textarea:eq(1)').attr('name','huxing_remark[]');
            //是否热门
            $(".huxing .images-upload:eq(0)").find('div.operation_6 input:eq(0)').attr('name','is_hot[]');
            // 删除按钮
            $(".huxing .images-upload:eq(0)").find('div.operation_6 a:eq(0)').attr('onclick',"ClearPicArr(this,'"+paths[i]+"')").html("<i class='fa fa-remove'></i>删除");
        }
    }
    //选择关联经纪人回调
    function set_relate_back(recall) {
        if ($("#relate_"+recall.id).length == 0){
            var html = '<span class="tower-add relate" id="relate_'+ recall.id +'" data-id="'+ recall.id +'">' +
                '<input type="hidden" name="relate[]" value="'+ recall.id +'">' +
                recall.true_name +
                '<i class="layui-icon layui-icon-close"></i>' +
                '</span>';
            $("#relate").append(html);
        }
        if ($("#sale_phone").val() == ''){
            $("#sale_phone").val(recall.mobile);
        }
    }
    $("#relate").on('click','i',function(){
        $(this).parent().remove();
    });
    //选择楼盘回调
    function set_house_back(recall){
        $("#province_id").val(recall['province_id']);
        $("#city_id").val(recall['city_id']);
        $("#area_id").val(recall['area_id']);
        $("#joinaid").val(recall['aid']);
        $("#title").val(recall['title']);
        $("#average_price").val(recall['original_price']);
        $('#join_title').html(recall['title']+ ' <i class="layui-icon layui-icon-close"></i>');
        $('#join_title').show();
        set_city_list(recall['city_id']);
        set_area_list(recall['area_id']);
        layui_index.form.render();
    }
    $("#join_title").on('click','i',function(){
        $("#join_title").html('');
        $('#join_title').hide();
        $("#joinaid").val(0);
    });
    //设置作者
    function set_author()
    {
        layer.prompt({
                title:'<font color="red">设置作者默认名称</font>'
            },
            function(val, index){
                var admin_id = '{$Think.session.admin_info.admin_id}';
                $.ajax({
                    url: "{:url('Admin/ajax_setfield')}",
                    type: 'POST',
                    dataType: 'JSON',
                    data: {id_name:'admin_id',id_value:admin_id,field:'pen_name',value:val},
                    success: function(res){
                        if (res.code == 1) {
                            $('#author').val(val);
                            layer.msg(res.msg, {icon: 1, time:1000});
                        } else {
                            showErrorMsg(res.msg);
                            return false;
                        }
                    },
                    error: function(e){
                        showErrorMsg();
                        return false;
                    }
                });
                layer.close(index);
            }
        );
    }
    //设置标签
    function tags_list(obj)
    {
        var url = "{:url('Tags/index')}";
        //iframe窗
        layer.open({
            type: 2,
            title: 'TAG标签管理',
            fixed: true, //不固定
            shadeClose: false,
            shade: 0.3,
            maxmin: true, //开启最大化最小化按钮
            area: ['80%', '80%'],
            content: url
        });
    }
</script>


{include file="public/footer" /}

